#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int leap(int year)
{
	if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
		return 1;
	else
		return 0;
}
int number(int year,int m,int d)
{
	int sum = 0;
	int i, a[12] = { 31,28,31,30,31,30,31,31,30,31,30,31 };
	int b[12] = { 31,29,31,30,31,30,31,31,30,31,30,31 };
	if (leap(year))
	{
		for (i = 0; i < m - 1; i++)
			sum += b[i];
	}
	else
	{
		for (i = 0; i < m - 1; i++)
			sum += a[i];
	}
	sum += d;
	return sum;
}
int main()
{
	int year, month, day;
	printf("Please input year month day:\n");
	scanf("%d%d%d", &year, &month, &day);
	printf("It is the %dth day in %d.\n", number(year, month, day), year);
	return 0;
}